package com.yingxin.yxerp.module.dingtalk.controller;

import com.yingxin.yxerp.module.dingtalk.service.IDingUserService;
import com.yingxin.yxerp.module.dingtalk.vo.DingUserRespVo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "手动触发钉钉测试")
@RestController
@RequestMapping("/ding/talk/test")
public class DingTalkTestController {

    @Autowired
    private IDingUserService userService;

    @PostMapping("/getUnionid")
    public void getUnionid() throws Exception {
        List<DingUserRespVo> userRespVoList = userService.getDepartUserList();
        for(DingUserRespVo user : userRespVoList ){
            System.out.println( "userId = " + user.getUserId() + ", userName = " + user.getRealName() + ", certNo = " + user.getCertNo() );
        }
    }

}
